<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>marginBug</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            .bigbox{
                width: 500px;
                height: 500px;
                background: #bbbbbe;
                /*border:2px solid red;*//*一：父元素加边框，可以解决margin的传递*/
                overflow: hidden;/*二：BFC,父元素加溢出隐藏*/
            }
            .smbox{
                width: 200px;
                height: 200px;
                background: #4d8000;
                margin-top: 300px;
            }
        </style>
    </head>
    <body>
        <div class="bigbox">
            <div class="smbox"></div>
        </div>
    </body>
</html>